/**
 * 金额单位转化
 * @param {*} amount 金额
 * @returns  string
 */
export function amountInvert(amount) {
    let n;
    if (!amount || Number(amount) < 100) {
        return amount;
    }
    if (typeof amount === 'string') {
        n = amount.replace(/,/g, '');
    }
    var p = n.indexOf('.');
    if (p >= 0) {
        n = n.substring(0, p);
    }
    var amountInvert = ['百', '千', '万', '十万', '百万', '千万', '亿', '十亿', '百亿', '千亿', '万亿', '十万亿'];
    return amountInvert[n.length - 3];
}
